package com.yyfax.pay.common.constants;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class FuiouProtocolPayConstant {

    @Resource
    private PayConstants payConstants;

    private String protocolPayNotifUrl = "/api/protocol/pay/result/notify";

    public static final int CACHETIME = 180;

    public static final String pattern = "yyyyMMdd";

    public static final String MCHNTCD = "MCHNTCD";

    public static final String APIFMS = "APIFMS";

    public static final String FM = "FM";

    public static final int CONNECT_TIMEOUT = 40000;

    public static final int READ_TIMEOUT = 40000;

    public static final String RESPONSE = "RESPONSE";

    /** 证件类型 */
    public static final String CERTIFYTYPE = "0";

    public static final String MESSAGE_TOKEN = "message_token_";

    public static final String ENCOCING = "UTF-8";

    public void setPayConstants(PayConstants payConstants) {
        this.payConstants = payConstants;
    }

    public PayConstants getPayConstants() {
        return payConstants;
    }

    public static int getCACHETIME() {
        return CACHETIME;
    }

    public String getProtocolPayNotifUrl() {
        return payConstants.getDomain().concat(protocolPayNotifUrl);
    }
}
